import { axios } from '@/utils/request'

export function getFlowFormDictData(parameter) { // 根据参数查字典{type:'table/code',value:'',label:'',code:''}
  return axios({
    url: '/sys/dict/getFlowFormDictData',
    method: 'post',
    data: parameter
  })
}

// 分页查询数据字典列表
export function queryByPage(data, params, saas) {
  return axios({
    url: '/onlcode/saas/dict/queryByPage',
    method: 'post',
    data,
    params,
    headers: {
      saas
    }
  })
}

// 新增或修改字典信息
export function saveOrUpdate(data, saas) {
  return axios({
    url: '/onlcode/saas/dict/saveOrUpdate',
    method: 'post',
    data,
    headers: {
      saas
    }
  })
}

// 根据id删除数据字典信息
export function removeById(data, saas) {
  return axios({
    url: '/onlcode/saas/dict/removeById',
    method: 'get',
    params: data,
    headers: {
      saas
    }
  })
}

// 分页查询数据字典明细列表
export function queryDictItemByPage(data, params, saas) {
  return axios({
    url: '/onlcode/saas/dictItem/queryByPage',
    method: 'post',
    data,
    params,
    headers: {
      saas
    }
  })
}

// 新增或修改字典明细
export function saveOrUpdateDictItem(data, saas) {
  return axios({
    url: '/onlcode/saas/dictItem/saveOrUpdate',
    method: 'post',
    data,
    headers: {
      saas
    }
  })
}

// 根据id删除数据字典信息
export function removeDictItemById(data, saas) {
  return axios({
    url: '/onlcode/saas/dictItem/removeById',
    method: 'get',
    params: data,
    headers: {
      saas
    }
  })
}

// 根据id删除数据字典信息
export function queryDictItemsByDictCode(data, saas) {
  return axios({
    url: '/onlcode/saas/dictItem/queryDictItemsByDictCode',
    method: 'get',
    params: data,
    headers: {
      saas
    }
  })
}

// 查询所有字典
export function queryAllDictItem(data, saas) {
  return axios({
    url: '/onlcode/saas/dict/queryAllDictItem',
    method: 'post',
    data,
    headers: {
      saas
    }
  })
}
